﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;

namespace HH.Domain
{
    class HHDbContext: DbContext
    {
        static HHDbContext()
        {
            Database.SetInitializer<HHDbContext>(null);
        }

        public HHDbContext()
            : base("name=hh-db")
        {
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Entities.Article>().ToTable("com_article");
            modelBuilder.Entity<Entities.Article>().HasKey(p => p.Id);

            //do something
            base.OnModelCreating(modelBuilder);
        }
    }
}
